package reese.think_in_java.java_17_contains;

import java.util.ArrayList;
import java.util.Collections;

/**
 * ***********************************************************
 *
 * @类名 : reese.think_in_java.java_17_contains.类名
 * @DESCRIPTION : 这家伙太懒啥都没写
 * @AUTHOR :  一个风情万种的男子
 * @DATE : 2016/6/16
 * ***********************************************************
 */

class StringAddress {
    private String s;
    public StringAddress(String s) { this.s = s; }
    public String toString() {
        return super.toString() + " " + s;
    }
}


public class FillingLists {
    public static void main(String[] args) {
        ArrayList<StringAddress> list = new ArrayList<>(Collections.nCopies(4, new StringAddress("hello")));

        System.out.println(list.toString());
        Collections.fill(list, new StringAddress("World!"));
        System.out.println(list.toString());

    }
}
